<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
<%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich" %>
<html>
<head>
	<title>Exemplo JSF</title>
</head>
<body>
<f:view>
  <h:form>

        <rich:toolBar>

            <rich:dropDownMenu>
                <f:facet name="label"> 
                    <h:panelGroup>
                        <h:graphicImage value="/images/icons/copy.gif" styleClass="pic"/>
                        <h:outputText value="File"/>
                    </h:panelGroup>
                </f:facet>
                <rich:menuItem submitMode="ajax" value="New"
                    action="#{ddmenu.doNew}" icon="/images/icons/create_doc.gif">
                </rich:menuItem>
                <rich:menuItem submitMode="ajax" value="Open"
                    action="#{ddmenu.doOpen}" icon="/images/icons/open.gif" />
                <rich:menuGroup value="Save As...">
                    <rich:menuItem submitMode="ajax" value="Save" 
                        action="#{ddmenu.doSave}" icon="/images/icons/save.gif" />
                    <rich:menuItem submitMode="ajax" value="Save All"
                        action="#{ddmenu.doSaveAll}">
                        <f:facet name="icon">
                            <h:graphicImage value="/images/icons/save_all.gif" />
                        </f:facet>
                    </rich:menuItem>
                </rich:menuGroup>
                <rich:menuItem submitMode="ajax" value="Close"
                    action="#{ddmenu.doClose}" />
                <rich:menuSeparator id="menuSeparator11" />
                <rich:menuItem submitMode="ajax" value="Exit"
                    action="#{ddmenu.doExit}" />

            </rich:dropDownMenu>

            <rich:dropDownMenu>

                <f:facet name="label">
                    <h:panelGrid cellpadding="0" cellspacing="0" columns="2"
                        style="vertical-align:middle">
                        <h:outputText value="Links" />
                    </h:panelGrid>
                </f:facet>

                <rich:menuItem submitMode="none"
                    onclick="document.location.href='http://labs.jboss.com/jbossrichfaces/'">
                    <h:outputLink value="http://labs.jboss.com/jbossrichfaces/">
                        <h:outputText value="RichFaces Home Page"></h:outputText>
                    </h:outputLink>
                </rich:menuItem>

                <rich:menuItem submitMode="none"
                    onclick="document.location.href='http://jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=261'">
                    <h:outputLink
                        value="http://jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=261">
                        <h:outputText value="RichFaces Forum"></h:outputText>
                    </h:outputLink>
                </rich:menuItem>

            </rich:dropDownMenu>
            <rich:toolBarGroup location="right">
                <rich:dropDownMenu value="Search" direction="bottom-left" jointPoint="br" styleClass="search">
                    <rich:menuItem submitMode="none">
                        <h:inputText value="" id="searchinput"/>
                        <button type="button">Search</button>
                    </rich:menuItem>
                    <rich:menuItem value="Enter your search criteria here" disabled="true"></rich:menuItem>
                </rich:dropDownMenu>
            </rich:toolBarGroup>
        </rich:toolBar>
    </h:form>
    
     
    <rich:spacer width="1" height="5"/>
    <br />
    <a4j:outputPanel ajaxRendered="true">
        <h:outputText value="Current Selection: "></h:outputText>
        <h:outputText style="font-weight:bold" value="#{ddmenu.current}"></h:outputText>
    </a4j:outputPanel>
    <br />
    <rich:spacer width="1" height="25" />


<h:form>
	<table>
		<tr>
			<td>Nome</td>
			<td><h:inputText value="#{cadastrarUsuario.usuario.nome}"/></td>
		</tr>
		<tr>
			<td>Login</td>
			<td><h:inputText value="#{cadastrarUsuario.usuario.login}"/></td>
		</tr>
		<tr>
			<td>Senha</td>
			<td><h:inputSecret value="#{cadastrarUsuario.usuario.senha}"/></td>
		</tr>
		<tr>
			<td>Email</td>
			<td><h:inputText value="#{cadastrarUsuario.usuario.email}"/></td>
		</tr>
		<tr>
			<td colspan="2">
				<a4j:commandLink action="#{cadastrarUsuario.cadastrarUsuario}" reRender="tabelaResultado">
					Cadastrar
				</a4j:commandLink>				
			</td>			
		</tr>
	</table>
</h:form>
	
	<rich:dataTable id="tabelaResultado" value="#{cadastrarUsuario.resultado}" 
				var="item">	
			<f:facet name="header">
				<rich:columnGroup>
					<rich:column>	
						Nome
					</rich:column>
					<rich:column>	
						Login
					</rich:column>
					<rich:column>	
						Email
					</rich:column>
				</rich:columnGroup>			
			</f:facet>
				<rich:column>
					<h:outputText value="#{item.nome}"/>
				</rich:column>
				<rich:column>
					<h:outputText value="#{item.login}"/>
				</rich:column>
				<rich:column>
					<h:outputText value="#{item.email}"/>
				</rich:column>			
	</rich:dataTable>		

</f:view>
</body>
</html>









